// app.js
App({
  onLaunch() {
    // 展示本地存储能力
    const logs = wx.getStorageSync('logs') || []
    logs.unshift(Date.now())
    wx.setStorageSync('logs', logs)

    // 登录
    wx.login({
      success: res => {
        // 发送 res.code 到后台换取 openId, sessionKey, unionId
      }
    })
  },
  globalData: {
    //当前登录用户
    user: null,
    //已支付课程
    paidCourses: [
      { id: 1, cover: 'https://via.placeholder.com/80', title: '心理科普：巴纳姆效应' },
      { id: 2, cover: 'https://via.placeholder.com/80', title: '心理科普：巴纳姆效应' },
      { id: 3, cover: 'https://via.placeholder.com/80', title: '心理科普：巴纳姆效应' }
    ],
    //未支付课程
    unpaidCourses: [
      { id: 1, cover: 'https://via.placeholder.com/80', title: '3-6岁幼儿期心理特点' },
      { id: 2, cover: 'https://via.placeholder.com/80', title: '心理防御机制' },
      { id: 3, cover: 'https://via.placeholder.com/80', title: '两个反抗期' }
    ],
    //通知
    notifications: [
      {
        id: 1,
        image: 'https://via.placeholder.com/100',
        title: '通知大标题1',
        content: '这里是通知的内容',
        time: '昨天'
      },
      {
        id: 2,
        image: 'https://via.placeholder.com/100',
        title: '通知大标题1',
        content: '这里是通知的内容',
        time: '星期三'
      },
      {
        id: 3,
        image: 'https://via.placeholder.com/100',
        title: '通知大标题1',
        content: '这里是通知的内容',
        time: '19/05/02'
      },
      {
        id: 4,
        image: 'https://via.placeholder.com/100',
        title: '通知大标题1',
        content: '这里是通知的内容',
        time: '19/04/30'
      }
    ],
    //已完成咨询
    completedConsultations: [
      {
        id: 1,
        consultant: '王大国',
        startTime: '2019-5-8 11:00',
        endTime: '2019-5-8 12:00',
        status: '已评价'
      },
      {
        id: 2,
        consultant: '刘备',
        startTime: '2019-5-8 11:00',
        endTime: '2019-5-8 12:00',
        status: '待评价'
      },
      {
        id: 3,
        consultant: '张飞',
        startTime: '2019-5-8 11:00',
        endTime: '2019-5-8 12:00',
        status: '待评价'
      }
    ],
    //未完成咨询
    uncompletedConsultations: [
      {
        id: 1,
        consultant: '关羽',
        startTime: '2019-6-8 11:00',
        endTime: '2019-6-8 12:00',
        status: '未完成'
      },
      {
        id: 2,
        consultant: '吕布',
        startTime: '2019-7-8 11:00',
        endTime: '2019-7-8 12:00',
        status: '未完成'
      },
      {
        id: 3,
        consultant: '赵云',
        startTime: '2019-8-8 11:00',
        endTime: '2019-8-8 12:00',
        status: '未完成'
      }
    ],
    //我的测评
    mockEvaluations: [
      {
        image: '/img/my/fj.png',
        title: '三年后是富还是穷',
        description: '千百年来，古人总把人的品格与自然之物相联系起来，以花草树木之品性喻人的精神情操。'
      },
      {
        image: '/img/my/fj.png',
        title: '测你心里最想要的的恋人是怎样的？',
        description: '千百年来，古人总把人的品格与自然之物相联系起来，以花草树木之品性喻人的精神情操。'
      },
      {
        image: '/img/my/fj.png',
        title: '你和什么星座的人最有缘分',
        description: '千百年来，古人总把人的品格与自然之物相联系起来，以花草树木之品性喻人的精神情操。'
      }
    ],
    //我的回答
    mockAnswers: [
      {
        user: '用户9527',
        time: '2019-5-8',
        content: '我好像真的心理有创伤，而且，我特别喜欢王乐乐这个...'
      },
      {
        user: '晴雯',
        time: '2019-4-30',
        content: '这是我新的开始，希望和王颖老师继续聊聊天'
      },
      {
        user: '大黄蜂',
        time: '2019-4-23',
        content: '变形金刚里的擎天柱是我大哥......'
      },
      {
        user: '暴雪美工',
        time: '2019-4-6',
        content: '敢不敢夸夸我设计的赞达拉巨魔，我觉得帅的一批，牛...'
      }
    ]
  },
  //设置全局请求URL
  globalData: {
    userInfo: null ,
    URL: 'http://localhost:8080/',
    losthost:'http://localhost:8080/img?imgUrl=images/ZXSWT/'
  }

})
